package com.test

class RaceController {
   	def scaffold = Race
	
	   
	def search = {
		flash.message = "Search results for: ${params.q}"
		def resultsMap = Race.search(params.q, params)
		render(view:'list',
			model:[raceInstanceList:resultsMap.results, raceInstanceTotal:Race.countHits(params.q)]
			)
		//render Race.search(params.q, params)
	}
/**	
	def index = {
		redirect(action:"list", params:params)
	}      
	
	def list = {
		params.max = Math.min(params.max?params.int('max'): 10, 100)
		[raceInstanceList: Race.list(params), raceInstanceTotal:User.count()]	//return是隐含
	}
	*/
	
}
